Skip to content

docs: explain OpenAPI integer bounds generation - #1721

Open
jeeeeetshahhhhh wants to merge 5 commits into
PokeAPI:masterfrom
jeeeeetshahhhhh:fix/local-postgres-openapi-generation
Open

jeeeeetshahhhhh wants to merge 5 commits into
PokeAPI:masterfrom
jeeeeetshahhhhh:fix/local-postgres-openapi-generation

Conversation

@jeeeeetshahhhhh

@jeeeeetshahhhhh jeeeeetshahhhhh commented Nov 12, 2026 •

Copy link
Copy Markdown

Summary

  • document how to regenerate the OpenAPI schema using the existing generate-openapi pre-commit command
  • explain that the configured DB backend determines integer bounds and generation does not query a live database

Addresses #1623 by explaining why SQLite and PostgreSQL can produce different integer bounds and how to regenerate the schema consistently.

Validation

  • git diff --check

@FallenDeity

FallenDeity commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

hi @jeeeeetshahhhhh i am not sure if a new config or makefile command is required given that this is already a defined step in pre-commit steps anyone interested can just use this command manually as well

entry: uv run manage.py spectacular --file openapi.yml --settings=config.docker_compose

in fact this dosent require docker running or a local postgres the config only serves the purpose of telling django spectacular whats the backend db like and based on that it decides the int bounds from the db int type no actual query to db is made

what i could see however is we can make a note of this behavior somewhere in contributing

@jeeeeetshahhhhh jeeeeetshahhhhh changed the title fix: make local OpenAPI generation use PostgreSQL docs: explain OpenAPI integer bounds generation Nov 12, 2026
@jeeeeetshahhhhh

Copy link
Copy Markdown
Author

Thanks for clarifying. I removed the extra settings module and Make target, and moved the change to CONTRIBUTING.md. It now documents the existing manual generate-openapi command and explains that schema generation uses the configured backend's integer types without querying a running database.

Comment thread CONTRIBUTING.md Resolved
@jeeeeetshahhhhh

Copy link
Copy Markdown
Author

Addressed in 78d62e6. I moved the database-backend/schema-generation explanation into the existing CONTRIBUTING note, removed the duplicate manual command instructions, and added the requested guidance to run pre-commit after model/schema changes and locally before opening a PR.

Updated instructions for running pre-commit hooks and clarified linting and typechecking enforcement.
@FallenDeity

FallenDeity commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

made a small revision to the comment lmk if it looks clear @jeeeeetshahhhhh i think we can skip the details regarding sqlite vs postgres int bounds seems too niche for a contributing.md when we already have the command to be used defined in pre-commit

people interested in the nuances can just checkout the command manually

cc: @Naramsim any thoughts regarding this? seems like a fair enough gotcha ppl might have encountered given mix between sqlite and postgres backends we use

@jeeeeetshahhhhh

Copy link
Copy Markdown
Author

Thanks for the revision. I removed the SQLite/PostgreSQL integer-bounds explanation and kept the CONTRIBUTING note focused on running pre-commit locally, regenerating openapi.yml after model/schema changes, and running the configured checks manually if pre-commit is unavailable. I also tightened the wording in 8731533.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants